from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views  #导入视图集

app_name = 'absent'
#GET /absent
#POST /absent
router = DefaultRouter(trailing_slash=False) #这样生成的路由不会自动添加/
router.register('absent',views.AbsentViewSet,basename='absent') #此处的absent前缀只服务于该视图集，与type无关
#在主路由已经加入前缀absent 此时网址为 http://localhost:8000/absent/absent
urlpatterns = [
    path('type',views.AbsentTypeViewSet.as_view(),name='absenttypes'),
                  #此时网址为 http://localhost:8000/absent/type
    path('responder',views.ResponderView.as_view(),name='getresponder')
] + router.urls